﻿CREATE TABLE [dbo].[BIEN](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Nombre] [nvarchar](350) NOT NULL,
	[Caracteristicas] [text] NOT NULL,
	[Codigo] [nvarchar](50) NOT NULL,
	[Serie] [nvarchar](max) NOT NULL,
	[Cantidad] [int] NOT NULL,
	[IdMarca] [int] NOT NULL,
	[IdCategoria] [int] NOT NULL,
 CONSTRAINT [PK_dbo.BIEN] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  ForeignKey [FK_dbo.BIEN_dbo.CATEGORIA_IdCategoria]    Script Date: 11/17/2014 00:41:42 ******/
ALTER TABLE [dbo].[BIEN]  WITH CHECK ADD  CONSTRAINT [FK_dbo.BIEN_dbo.CATEGORIA_IdCategoria] FOREIGN KEY([IdCategoria])
REFERENCES [dbo].[CATEGORIA] ([ID])
GO

ALTER TABLE [dbo].[BIEN] CHECK CONSTRAINT [FK_dbo.BIEN_dbo.CATEGORIA_IdCategoria]
GO
/****** Object:  ForeignKey [FK_dbo.BIEN_dbo.MARCA_IdMarca]    Script Date: 11/17/2014 00:41:42 ******/
ALTER TABLE [dbo].[BIEN]  WITH CHECK ADD  CONSTRAINT [FK_dbo.BIEN_dbo.MARCA_IdMarca] FOREIGN KEY([IdMarca])
REFERENCES [dbo].[MARCA] ([ID])
GO

ALTER TABLE [dbo].[BIEN] CHECK CONSTRAINT [FK_dbo.BIEN_dbo.MARCA_IdMarca]
GO
CREATE NONCLUSTERED INDEX [IX_IdCategoria] ON [dbo].[BIEN] 
(
	[IdCategoria] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_IdMarca] ON [dbo].[BIEN] 
(
	[IdMarca] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]